Kernel_Dir ?=/mnt/kernel

CONFIG_FILE := $(KDIR)/.config

Kernel_Include := $(Kernel_Dir)/include/
 
# 设置目标架构
ARCH := arm64
# 配置交叉编译器
CROSS_COMPILE := aarch64-linux-gnu- 
 

obj-m := gp7101_backlight_i2c.o


# ccflags-y += -std=c99 虽然可以保证我的源码没问题，但是 linux-headers 里面的编译报错



all:
	make -C $(Kernel_Dir) M=$(PWD) modules ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE)

# 清理构建产物
clean:
	rm -rf *.cmd *.o *.ko *.order *.mod *.symvers  .my_gpio* *.mod.c